﻿<%@ Page Language="C#" MasterPageFile="~/MainMT.master" AutoEventWireup="true" CodeFile="AdHM.aspx.cs" Inherits="AdHM" Title="长春校园人才网-校园代理" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:FormView ID="FormView1" runat="server" AllowPaging="True" CellPadding="4" 
        DataKeyNames="hmid" DataSourceID="SqlDataSource1" ForeColor="#333333" 
        Height="104px" HorizontalAlign="Center" Width="342px" DefaultMode="Insert">
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <EditItemTemplate>
            <table style="width:100%; border-right: green 1px solid; table-layout: fixed; border-top: green 1px solid; border-left: green 1px solid; border-bottom: green 1px solid; border-collapse: collapse;">
                <tr>
                    <td>
                        姓名：</td>
                    <td style="width: 161px">
                        <asp:TextBox ID="hmnameTextBox" runat="server" Text='<%# Bind("hmname") %>' />
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ControlToValidate="hmnameTextBox" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        年龄：</td>
                    <td style="width: 161px">
                        <asp:TextBox ID="hmageTextBox" runat="server" Text='<%# Bind("hmage") %>' />
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                            ControlToValidate="hmageTextBox" ErrorMessage="*"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        性别：</td>
                    <td style="width: 161px">
                        <asp:DropDownList ID="DropDownList2" runat="server" 
                            SelectedValue='<%# Bind("hmsex") %>'>
                            <asp:ListItem>男</asp:ListItem>
                            <asp:ListItem>女</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                            ControlToValidate="hmsexTextBox" ErrorMessage="*"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td style="height: 26px">
                        电话：</td>
                    <td style="width: 161px; height: 26px;">
                        <asp:TextBox ID="hmtelTextBox" runat="server" Text='<%# Bind("hmtel") %>' />
                    </td>
                    <td style="height: 26px">
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                            ControlToValidate="hmtelTextBox" ErrorMessage="*"></asp:RequiredFieldValidator>
                    </td>
                </tr>
            </table>
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="更新" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="取消" />
        </EditItemTemplate>
        <InsertItemTemplate>
            <table style="width:100%; border-right: white 1px solid; table-layout: fixed; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid; border-collapse: collapse;">
                <tr>
                    <td>
                        姓名：</td>
                    <td style="width: 161px">
                        <asp:TextBox ID="hmnameTextBox0" runat="server" Text='<%# Bind("hmname") %>' />
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                            ControlToValidate="hmnameTextBox0" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        年龄：</td>
                    <td style="width: 161px">
                        <asp:TextBox ID="hmageTextBox0" runat="server" Text='<%# Bind("hmage") %>' />
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                            ControlToValidate="hmageTextBox0" ErrorMessage="*"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        性别：</td>
                    <td style="width: 161px">
                        <asp:DropDownList ID="DropDownList1" runat="server" 
                            SelectedValue='<%# Bind("hmsex") %>'>
                            <asp:ListItem>男</asp:ListItem>
                            <asp:ListItem>女</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                            ControlToValidate="hmsexTextBox0" ErrorMessage="*"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        电话：</td>
                    <td style="width: 161px">
                        <asp:TextBox ID="hmtelTextBox0" runat="server" Text='<%# Bind("hmtel") %>' />
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                            ControlToValidate="hmtelTextBox0" ErrorMessage="*"></asp:RequiredFieldValidator>
                    </td>
                </tr>
            </table>
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="插入" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" Text="浏览" PostBackUrl="~/HM.aspx" />
        </InsertItemTemplate>
        <ItemTemplate>
            <table cellpadding="5" style="width:100%; border-right: green 1px solid; table-layout: fixed; border-top: green 1px solid; border-left: green 1px solid; border-bottom: green 1px solid; border-collapse: collapse;">
                <tr>
                    <td style="width: 84px; height: 26px; text-align: center">
                        姓名:
                    </td>
                    <td style="height: 26px; text-align: left">
                        <asp:Label ID="hmnameLabel" runat="server" Text='<%# Bind("hmname") %>' />
                    </td>
                </tr>
                <tr>
                    <td style="width: 84px; height: 26px; text-align: center">
                        年龄:
                    </td>
                    <td style="height: 26px; text-align: left">
                        <asp:Label ID="hmageLabel" runat="server" Text='<%# Bind("hmage") %>' />
                    </td>
                </tr>
                <tr>
                    <td style="width: 84px; height: 26px; text-align: center">
                        性别:</td>
                    <td style="height: 26px; text-align: left">
                        <asp:Label ID="hmsexLabel" runat="server" Text='<%# Bind("hmsex") %>' />
                    </td>
                </tr>
                <tr>
                    <td style="width: 84px; height: 26px; text-align: center">
                        电话:
                    </td>
                    <td style="height: 26px; text-align: left">
                        <asp:Label ID="hmtelLabel" runat="server" Text='<%# Bind("hmtel") %>' />
                    </td>
                </tr>
            </table>
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                CommandName="Edit" Text="编辑" />
&nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                CommandName="Delete" Text="删除" />
            &nbsp;
        </ItemTemplate>
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="#FF8000" />
        <HeaderTemplate>
            高级会员（人员管理）
        </HeaderTemplate>
        <EditRowStyle BackColor="#999999" />
    </asp:FormView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConflictDetection="CompareAllValues" 
        ConnectionString="<%$ ConnectionStrings:DB_CCXYRCConnectionString %>" 
        DeleteCommand="DELETE FROM [tb_hm] WHERE [hmid] = @original_hmid" 
        InsertCommand="INSERT INTO [tb_hm] ([pid], [hmname], [hmage], [hmsex], [hmtel]) VALUES (@pid, @hmname, @hmage, @hmsex, @hmtel)" 
        OldValuesParameterFormatString="original_{0}" 
        SelectCommand="SELECT * FROM [tb_hm] WHERE ([pid] = @pid)" 
        UpdateCommand="UPDATE [tb_hm] SET [hmname] = @hmname, [hmage] = @hmage, [hmsex] = @hmsex, [hmtel] = @hmtel WHERE [hmid] = @original_hmid AND [pid] = @original_pid">
        <SelectParameters>
            <asp:SessionParameter Name="pid" SessionField="person" Type="String" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="original_hmid" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="hmname" Type="String" />
            <asp:Parameter Name="hmage" Type="Int32" />
            <asp:Parameter Name="hmsex" Type="String" />
            <asp:Parameter Name="hmtel" Type="String" />
            <asp:Parameter Name="original_hmid" Type="Int32" />
            <asp:Parameter Name="original_pid" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="pid" Type="String" />
            <asp:Parameter Name="hmname" Type="String" />
            <asp:Parameter Name="hmage" Type="Int32" />
            <asp:Parameter Name="hmsex" Type="String" />
            <asp:Parameter Name="hmtel" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:Label ID="Label1" runat="server"></asp:Label>
</asp:Content>

